package cate.game.play.buff.h;

import cate.game.play.buff.BuffHandler;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.proce.action.ctx.TimeActionCtx;
import cate.game.play.proce.move.MoveCtx;

/**
 * 效果：若再持续时间内复活，为携带此状态的目标附加【失魂】
 * 强化效果： 出手时，损失携带此状态的目标自身攻击力60%的生命值
 */
public class 黄泉梦境BH extends BuffHandler {

	private int 复活buff;

	private double 伤害系数;

	//复活buff=？？&伤害系数=6000
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		复活buff = args.getInt("复活buff", 0);
		伤害系数 = args.getWDouble("伤害系数", 0d);
	}

	@Override
	public void parseExt(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		伤害系数 += args.getWDouble("伤害系数", 0d);
	}

	@Override
	public void onResurrect(ActionCtx action) {
		buff.owner.buff.tryAddByTid(action, 复活buff);
	}

	@Override
	public void onOwnerMoveDone(MoveCtx move, TimeActionCtx action) {
		buff.owner.attr.buffHurt(action, buff.caster, buff.owner.attr.attTotal() * 伤害系数);
	}
}
